﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MemoryGames.Games.WrongWord
{
	/// <summary>
	/// Interaction logic for Answer.xaml
	/// </summary>
	public partial class Answer : UserControl
	{
		#region "Constructors"
		public Answer(DataRow a)
		{
			InitializeComponent();
			AnswerLabel.Content = a["Answer"];
			CorrectAnswer = Convert.ToBoolean(a["CorrectAnswer"]);
		}
		#endregion

		#region "Properties"
		public bool CorrectAnswer { get; set; }
		#endregion

		private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			if (CorrectAnswer==true)
			{
				Storyboard sb = (Storyboard) this.FindResource("Good");
				sb.Begin();
			}
			else
			{
				Storyboard sb = (Storyboard)this.FindResource("Wrong");
				sb.Begin();
			}
		}

	}
}